Cousin of the ListEditor widget. Both return their result as an XML list document. The DynamicTable allows editing of lists where only columns displayed in the list are editable fields. Columns are displayed in the order that they are specified in the meta-data.
OnChange returns:
| onError |
fires on error (when m_bDebug = true in HTC, shows alert as well)
event object propertieswindow.event.error String. Returns error detail. |
| onChange |
fires after user clicks 'Done' or 'Remove' buttons.
event object propertieswindow.event.XMLlist XMLNode. XML document node containing the list. Each row is in a child <record> node containing a sub-node for each field/column. Each <record> node is marked by a state attribute with one of four values: "" = unchanged, "new", "changed", or "deleted". Select columns return as two sub-nodes; one with the name of the column that contains the underlying value, and one named columnId_displayvalue containing the display name for that value. (this test page simply displays the event.XMLlist.xml in the text area above) NOTE: if @overx meta-xml attribute is used the "Over X" record key will have the value "-1". |
| onRequire |
fires when required status changes on the list
event object propertieswindow.event.required Boolean. Returns true if the control is marked as required and the table is currently empty, false otherwise |
| onValid |
fires when a user starts to edit a row and when they complete editing a row
event object propertieswindow.event.valid Boolean. Returns false if fired because user started to edit a row, false when Cancel or Accept is clicked |
| set elEditField = elDynamicTable.field(sFieldId) |
Gets the sub-control field element (HTML element with HTC attached)
parameterssFieldId Required. ID of field (column/field name in recordset). return valueHTMLElement. Returns the sub-control element for the field if sFieldId is a valid field in the elDynamicTable, null otherwise remarksOnce you have used this method to get a field control element you can use any of the methods and properties available to an EditField control. Please see the EditField reference for details. |
| elDynamicTable.cleanup() |
Removes all records marked with state='deleted' and clears the state attribute for
all remaining records
parametersnone return valuenone |
| DataXML |
xml data (from a recordset) data-island id. Usually in the format:
<document> <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... </record> ... </document> |
| MetaXML | xml meta-data data-island id |
| bValue = elDynamicTable.dirty |
| Read-only. Returns true if a row has been added, removed or edited, false otherwise. |
| bValue = elDynamicTable.required |
| Read-only. Returns true if the field is required and currently has no value, false otherwise. OnRequire event fires when this value changes. NOTE: if @overx meta-xml attribute is used required will always be false (since the "Over X" row is added). |
| set xmlList = elDynamicTable.XMLlist |
| Read-only. XML document node containing the list. Each row is in a child <record> node containing a sub-node for each field/column. Each record is marked by a state attribute with one of four values: "" = unchanged, "new", "changed", or "deleted". Select columns return two sub-nodes; one with the name of the column containing the underlying value and one named columnId_displayvalue containing the display name for that value. NOTE: if @overx meta-xml attribute is used the "Over X" record key will have the value "-1". |
<xml id='dtMeta'>
<dynamictable>
<global keycol='quantity' required='yes' uniquekey='yes' sortbykey='yes'/>
<fields>
<numeric id='quantity' width='180' required='yes'
min='1' max='999' subtype='integer'>
<name>Quantity, up to:</name>
<prompt><Type a quantity></prompt>
<error></error>
</numeric>
<numeric id='rate' width='125' required='yes' min='1' max='999' subtype='float'>
<name>Shipping rate:</name>
<prompt><Type a rate></prompt>
<error></error>
</numeric>
<text id='foo' hide='yes' subtype='short'>
<name>hidden column</name>
<prompt></prompt>
<error>hidden column error</error>
</text>
<text id='text' width='145' required='yes' maxlen='30' subtype='short'>
<name>Shipping text:</name>
<prompt><Type shipping text></prompt>
<error></error>
</text>
</fields>
</dynamictable>
</xml>